<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>generator</h2>
   
</body>
<script>
    // function *getData() {
    //     yield  'hello';
    //     yield 'react';
    //     yield 'vue.js';

    // }

    //async/await本质上是generator语法糖
   async function getData() {
       const res1=await  'hello111';
       const res2= await 'react111';
       const res3=await 'vue.js111';

       console.log(res1)
       console.log(res2)
       console.log(res3)

    }

    getData()

   // const gen=getData()

    // console.log(gen.next())
    // console.log(gen.next())

    // for(let item of getData()) {
    //     console.log('item:',item)
    // }



</script>
</html>